<ion-view view-title="题库">
    <ion-content class="store-box">
        <!--<h4 class="align-center text-center">{{store.text}}</h4>-->
        <ion-refresher class="invisible" pulling-text="刷新" on-refresh="refreshBattle()">
        </ion-refresher>

        <div class="button-bar battle-bar battle-wp">
            <a class="button button-royal" ng-click="newPractice()">
                <button class="practice-btn" >练兵场</button>
            </a>

            <a class="button button-royal" ng-click="newBattle()">
                <button class="battle-btn">建战场</button>
            </a>
        </div>

        <div class="store-body">
            <div class="list card" ng-repeat="battle in battles">
                <div class="item item-divider">{{battle.store.text}}</div>
                <div class="item item-body">
                    <div>
                        <label class="item item-input">
                            <span class="input-label text-right" style="width: 65px;">创建人:</span>
                            <span ng-bind="battle.owner.name"></span>
                            <span class="input-label text-right" style="width: 65px;">状态:</span>
                            <span ng-bind="battle.status | zhuangtai"></span>
                        </label>
                        <label class="item item-input">
                            <span class="input-label text-right" style="width: 65px;">时间:</span>
                            <span ng-bind="battle.createTime | shijian"></span>
                        </label>
                        <!--
                        <label class="item item-input">
                            <span class="input-label text-right" style="width: 65px;">状态:</span>
                            <span ng-bind="getStatusName(battle.status)"></span>
                        </label>
                        <label class="item item-input">
                            <span class="input-label text-right" style="width: 65px;">时间:</span>
                            <span ng-bind="battle.createTime"></span>
                        </label>
                        -->
                        <label class="item item-input">
                            <span class="input-label text-right" style="width: 65px;">参赛人员:</span>
                            <p class="battle users">
                                <span class="user" ng-repeat="user in battle.users" ng-bind="user.name"></span>
                            </p>
                        </label>
                    </div>
                    <!-- 尚未开始的对战才可以进入 -->
                    <div class="button-bar" ng-show="battle.status == 'N'">
                        <a class="button button-positive" ng-click="joinBattle(battle._id)">
                            <i class="ion ion-person-add"></i>进入</a>
                    </div>
                </div>
            </div>
            <div class="nobattle-box" ng-if="!battles.length">
                <!--<p class="row1">这里的硝烟刚刚熄灭，</p>
                <p class="row2">快来建立自己的战场吧！</p>-->
            </div>
        </div>
        <div class="text-center" style="margin-top:15px;">
            <a ng-show="showBattleMore" ng-click="moreBattle()">更多</a>
        </div>

    </ion-content>
</ion-view>